MTR04_1120


Posted by cwc329 on 2020-11-21

20201120 week 23 day 05

O

  1. w21 hw3 50%。

R

  1. 無。

I

  1. React components 傳 props 可以用 destruction,而且如果有對應到 attributes,還會自動轉換。
    App.js

    const Component = () => {
     const [attributes, setAttributes] = useState({
         value: 5,
         name: 'age'
     });
    
     return (  
         <div>
             <input {...attributes} />
         </div>
    )
    }
    

    output HTML

    <input name="age" value="5" />
    

    而且如果寫 onChange: () => {} 也會自動轉換成事件處理。

D

  1. w21 hw。









Related Posts

【文章筆記 】CS75 (Summer 2012) Lecture 9 Scalability Harvard Web Development David Malan

【文章筆記 】CS75 (Summer 2012) Lecture 9 Scalability Harvard Web Development David Malan

[坑] It’s MIME type ('text/html') is not a supported stylesheet MIME type

[坑] It’s MIME type ('text/html') is not a supported stylesheet MIME type

[Week6] CSS 選取器:全域選擇器、:nth-child()

[Week6] CSS 選取器:全域選擇器、:nth-child()


Comments